<!--
 * @Description:
 * @Version: 1.0.0
 * @Autor: zhou
 * @Date: 2022-04-23 11:49:20
 * @LastEditors: yel
 * @LastEditTime: 2022-08-30 18:01:58
-->
<template>
    <div class="container full-screen">
        <!-- 1左侧 -->
        <div
            v-show="!epi.open_detail"
            class="left flexcbh position-re pro-bgcolor544 p-20"
        >
            <pro-title label="核酸检测率排行"></pro-title>

            <div
                class="left-content fx1 flexcsh"
                v-loading="loading"
                element-loading-background="rgba(0, 0, 0, 0.3)"
            >
                <div class="search_box s_box m-b10">
                    <el-select v-model="epi.detection">
                        <el-option label="第一轮" :value="1" />
                        <el-option label="第二轮" :value="2" />
                        <el-option label="第三轮" :value="3" />
                        <el-option label="第四轮" :value="4" />
                    </el-select>

                    <div class="search_btn flexrcc" @click="searchChange">
                        <span class="txt">查 看</span>
                    </div>
                    <div class="reset_btn flexrcc" @click="searchChange(2)">
                        <span class="txt">最近一次</span>
                    </div>
                </div>
                <div class="sort_box flexrbh m-b10">
                    <div
                        class="sort_btn fx1 flexrcc"
                        :class="epi.queryForm.sort_by ? '' : 'active'"
                        @click="searchChange(3)"
                    >
                        <span class="txt">倒序</span>
                    </div>
                    <div
                        class="sort_btn fx1 flexrcc"
                        :class="epi.queryForm.sort_by ? 'active' : ''"
                        @click="searchChange(4)"
                    >
                        <span class="txt">正序</span>
                    </div>
                </div>

                <div class="fx1 hidden">
                    <StaticTable
                        :columns="epi.columns1"
                        :data-list="epi.data"
                        headBg="rgba(22, 159, 196, 0.2)"
                        border_color="rgba(0, 0, 0, 0)"
                        :show_head="true"
                        rowHeight="40"
                    >
                        <template v-slot:title="scope">
                            <div class="title_box">{{ scope.row.title }}</div>
                        </template>

                        <template v-slot:col3="scope">
                            <el-progress
                                class="process_line"
                                :percentage="scope.row.col3"
                                :show-text="true"
                                :text-inside="false"
                                style="
                                    height: 100%;
                                    align-items: center;
                                    display: flex;
                                "
                                :stroke-width="9"
                            ></el-progress>
                        </template>
                    </StaticTable>
                </div>
                <!-- 分页 -->
                <ProPage
                    :pages="epi.pages"
                    :total="epi.total"
                    ref="ref_page1"
                    @on_page="changePage($event, 1)"
                ></ProPage>
            </div>
        </div>

        <!-- 2 中间 -->

        <!-- 3 右侧 -->
        <div
            v-show="!epi.open_detail"
            class="right flexcbh position-re pro-bgcolor544 p-20"
        >
            <pro-title label="港区网格"></pro-title>

            <div
                class="right-content fx1 flexcsh"
                v-loading="loading2"
                element-loading-background="rgba(0, 0, 0, 0.3)"
            >
                <div class="search_box s_box m-b10">
                    <el-input
                        v-model="epi.queryForm2.gridName"
                        placeholder="请输入内容"
                    ></el-input>
                    <div class="search_btn flexrcc" @click="searchChange2(0)">
                        <span class="txt">搜 索</span>
                    </div>
                    <div class="reset_btn flexrcc" @click="searchChange2(-1)">
                        <span class="txt">重 置</span>
                    </div>
                </div>
                <div class="grade_box m-b10">
                    <div
                        class="sort_btn flexrcc"
                        :class="epi.queryForm2.level == 1 ? 'active' : ''"
                        @click="searchChange2(1)"
                    >
                        <span class="txt">区/县</span>
                    </div>
                    <div
                        class="sort_btn flexrcc"
                        :class="epi.queryForm2.level == 2 ? 'active' : ''"
                        @click="searchChange2(2)"
                    >
                        <span class="txt">街道/乡镇</span>
                    </div>
                    <div
                        class="sort_btn flexrcc"
                        :class="epi.queryForm2.level == 3 ? 'active' : ''"
                        @click="searchChange2(3)"
                    >
                        <span class="txt">村委/社区</span>
                    </div>
                    <div
                        class="sort_btn flexrcc"
                        :class="epi.queryForm2.level == 4 ? 'active' : ''"
                        @click="searchChange2(4)"
                    >
                        <span class="txt">自然村</span>
                    </div>
                </div>

                <div class="fx1 hidden">
                    <StaticTable
                        :columns="epi.columns2"
                        :data-list="epi.data2"
                        headBg="rgba(22, 159, 196, 0.2)"
                        border_color="rgba(22, 159, 196, 0.25)"
                        @onRow="onRow2"
                        headHeight="36"
                        rowHeight="40"
                    >
                    </StaticTable>
                </div>
                <!-- 分页 -->
                <ProPage
                    :pages="epi.pages2"
                    :total="epi.total2"
                    ref="ref_page2"
                    @on_page="changePage($event, 2)"
                ></ProPage>
            </div>
        </div>

        <!-- 4弹窗列表 -->
        <div class="dialog_box flexrcc" v-if="epi.open_detail">
            <ListDetail :title="epi.detail_title" @close_info="onCloseInfo">
                <div class="full-screen flexcsh">
                    <div class="p-row30">
                        <EpiContentNav
                            :list="epi.detail_btn"
                            @change="changeContent"
                        ></EpiContentNav>
                    </div>

                    <div
                        v-if="epi.cut_content == 1"
                        class="dialog_content1 p-row30 flexrbh fx1 hidden"
                    >
                        <div class="content_left m-r20">
                            <div class="item item_grid1 m-b20 flexrcc">
                                <div class="icon icon1"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num1">{{
                                            Math.ceil(epi.total12 / 4)
                                        }}</span>
                                        <span class="unit unit1">户</span>
                                    </div>
                                    <div class="label label1">住户数</div>
                                </div>
                            </div>
                            <div class="item item_grid2 m-b20 flexrcc">
                                <div class="icon icon2"></div>
                                <div class="info">
                                    <div class="p-row10">
                                        <span class="num num2">{{
                                            epi.total12
                                        }}</span>
                                        <span class="unit unit2">人</span>
                                    </div>
                                    <div class="label label2">居民数</div>
                                </div>
                            </div>
                        </div>
                        <div class="content_right flexcbh fx1">
                            <div class="item top m-b20">
                                <div class="flex m-b10">
                                    <div class="label">上级网格:</div>
                                    <div class="value"></div>
                                </div>
                                <div class="flex">
                                    <div class="label">下级网格:</div>
                                    <div class="list fx1">
                                        <span
                                            class="list_item"
                                            v-for="(item, index) in epi.data11
                                                .nextGridList"
                                            :key="index"
                                            >{{ item }}</span
                                        >
                                    </div>
                                </div>
                            </div>
                            <div class="item bottom flexcsh fx1">
                                <div class="flexrsc m-b10">
                                    <div class="label">负责人:</div>
                                    <div class="value">
                                        {{ epi.data11.gridLeaderName }}
                                    </div>
                                    <div class="tel">
                                        {{ epi.data11.gridLeaderMobile }}
                                    </div>
                                </div>
                                <div class="flex of-xhya scroll_bar">
                                    <div class="label">网格员:</div>
                                    <div class="">
                                        <div
                                            v-for="(item, index) in epi.data11
                                                .gridWorkerVOList"
                                            :key="index"
                                        >
                                            <span class="value">{{
                                                item.name
                                            }}</span>
                                            <span class="tel">{{
                                                item.mobile
                                            }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div
                        v-else-if="epi.cut_content == 2"
                        class="dialog_content2 full-screen flexcbh"
                    >
                        <div class="flexrbh m-b10">
                            <div class="info_box fx1 flexrb m-r20">
                                <div class="fx1 flexrcc">
                                    <span class="label">住户数: </span>
                                    <span class="value">{{
                                        Math.ceil(epi.total12 / 4)
                                    }}</span>
                                </div>
                                <div class="fx1 flexrcc">
                                    <span class="label">居民数: </span>
                                    <span class="value">{{ epi.total12 }}</span>
                                </div>
                            </div>
                            <div class="search_box s_box fx1">
                                <el-input
                                    v-model="epi.queryForm12.name"
                                    placeholder="请输入内容"
                                ></el-input>
                                <div
                                    class="search_btn flexrcc"
                                    @click="searchChange12(0)"
                                >
                                    <span class="txt">搜 索</span>
                                </div>
                                <div
                                    class="reset_btn flexrcc"
                                    @click="searchChange12(-1)"
                                >
                                    <span class="txt">重 置</span>
                                </div>
                            </div>
                        </div>

                        <div class="fx1 hidden">
                            <StaticTable
                                :columns="epi.columns12"
                                :data-list="epi.data12"
                                headBg="rgba(22, 159, 196, 0.2)"
                                border_color="rgba(22, 159, 196, 0.25)"
                                headHeight="40"
                            >
                                <template v-slot:col4="{ row }">
                                    <div class="census epi_census">
                                        {{ row.col4 }}
                                    </div>
                                </template>
                            </StaticTable>
                        </div>
                        <!-- 分页 -->
                        <ProPage
                            :pages="epi.pages12"
                            :total="epi.total12"
                            ref="ref_page12"
                            @on_page="changePage($event, 12)"
                        ></ProPage>
                    </div>

                    <div
                        v-else-if="epi.cut_content == 3"
                        class="dialog_content3 full-screen flexcb"
                    >
                        <div class="select_box flexrsc m-b20">
                            <span class="icon">*</span>
                            <span class="label">检测轮次</span>
                            <div class="select_grade m-r30">
                                <el-select v-model="epi.roundId" placeholder="">
                                    <el-option
                                        v-for="item in epi.options13"
                                        :key="item.value"
                                        :label="item.label"
                                        :value="item.value"
                                    >
                                    </el-option>
                                </el-select>
                            </div>
                            <div
                                class="search_btn flexrcc m-r20"
                                @click="searchChange13(0)"
                            >
                                <span class="txt">查 看</span>
                            </div>
                            <div
                                class="reset_btn flexrcc"
                                @click="searchChange13(-1)"
                            >
                                <span class="txt">最近一次</span>
                            </div>
                        </div>
                        <div class="data_box fx1">
                            <div class="box1 flexcbh">
                                <div class="box1_top flexccc m-b20">
                                    <div class="">
                                        <span class="num text">{{
                                            epi.data13.peopleNumber
                                        }}</span>
                                        <span class="unit text">人</span>
                                    </div>
                                    <div class="label">员工数量</div>
                                </div>
                                <div class="box1_bottom fx1 flexcbh">
                                    <div class="fx1 flexccc">
                                        <div class="flexrbc">
                                            <span class="num text"
                                                >{{
                                                    epi.data13.currentRatio *
                                                    100
                                                }}%</span
                                            >
                                            <div class="rise">
                                                <span
                                                    class="iconfont icon-shangsheng"
                                                ></span>
                                                <span
                                                    >{{
                                                        epi.data13.ratio.toFixed(
                                                            2
                                                        ) * 100
                                                    }}%</span
                                                >
                                            </div>
                                        </div>
                                        <div class="label">本轮检测率</div>
                                    </div>
                                    <div class="fx1 flexccc">
                                        <div class="">
                                            <span class="num text"
                                                >{{
                                                    epi.data13.lastRatio.toFixed(
                                                        2
                                                    ) * 100
                                                }}%</span
                                            >
                                        </div>
                                        <div class="label">上轮检测率</div>
                                    </div>
                                </div>
                            </div>
                            <div class="box2 flexcbh">
                                <div class="box2_top fx1 m-b20 flexcbc">
                                    <div class="chart_box flexrcc m-b10">
                                        <pie-chart
                                            :seriesData="epi.seriesDataPie"
                                            :extraOption="epi.extraOptionPie"
                                        ></pie-chart>
                                    </div>
                                    <div class="info flexcc fx1">
                                        <div class="item top flexrbc m-b10">
                                            <span
                                                ><span class="icon">▋</span
                                                >本轮已检测</span
                                            >
                                            <span class="num">{{
                                                epi.data13.detectedNumber
                                            }}</span>
                                            <span class="num"
                                                >{{
                                                    epi.data13.currentRatio *
                                                    100
                                                }}%</span
                                            >
                                        </div>
                                        <div class="item bottom flexrbc">
                                            <span
                                                ><span class="icon">▋</span
                                                >本轮未检测</span
                                            >
                                            <span class="num">{{
                                                epi.data13.noDetectNumber
                                            }}</span>
                                            <span class="num"
                                                >{{
                                                    (
                                                        1 -
                                                        epi.data13.currentRatio
                                                    ).toFixed(2) * 100
                                                }}%</span
                                            >
                                        </div>
                                    </div>
                                </div>
                                <div class="box2_bottom flexcc">
                                    <span class="label m-b10"
                                        >本轮新增未测 (人)</span
                                    >
                                    <span class="num">{{
                                        epi.data13.currentAddNoDetectNumber
                                    }}</span>
                                </div>
                            </div>
                            <div class="box3 flexcbh">
                                <div class="box3_top fx1 m-b20 flexcbc">
                                    <div class="chart_box flexrcc m-b10">
                                        <pie-chart
                                            :seriesData="epi.seriesDataPie2"
                                            :extraOption="epi.extraOptionPie2"
                                        ></pie-chart>
                                    </div>
                                    <div class="info flexcc fx1">
                                        <div class="item top flexrbc m-b10">
                                            <span
                                                ><span class="icon">▋</span
                                                >已核实总数</span
                                            >
                                            <span class="num">{{
                                                epi.data13.verifiedNumber
                                            }}</span>
                                            <span class="num"
                                                >{{
                                                    epi.data13.verifiedRatio *
                                                    100
                                                }}%</span
                                            >
                                        </div>
                                        <div class="item bottom flexrbc">
                                            <span
                                                ><span class="icon">▋</span
                                                >未核实总数</span
                                            >
                                            <span class="num">{{
                                                epi.data13.noVerifiedNumber
                                            }}</span>
                                            <span class="num"
                                                >{{
                                                    epi.data13.verifiedNumber +
                                                        epi.data13
                                                            .noVerifiedNumber ==
                                                    0
                                                        ? "0"
                                                        : (1 -
                                                              epi.data13
                                                                  .verifiedRatio) *
                                                          100
                                                }}
                                                %</span
                                            >
                                        </div>
                                    </div>
                                </div>
                                <div class="box3_bottom flexcc">
                                    <span class="label m-b10"
                                        >近两轮均未测 (人)</span
                                    >
                                    <span class="num">{{
                                        epi.data13.twoRoundNoDetectNumber
                                    }}</span>
                                </div>
                            </div>
                            <div class="box4 flexcbc">
                                <div class="box41">
                                    <gauge-chart
                                        :seriesData="epi.seriesDataGauge"
                                        :seriesData2="epi.seriesDataGauge2"
                                        :extraOption="epi.extraOptionsGauge"
                                    ></gauge-chart>
                                </div>
                                <div class="box42 m-b10 flexrcc">
                                    上轮整改率
                                </div>
                                <div class="box43 m-b10 flexccc">
                                    <div class="">
                                        <span class="num text">{{
                                            epi.data13.lastNoDetectNumber
                                        }}</span>
                                        <span class="unit text">人</span>
                                    </div>
                                    <div class="label">上轮未测</div>
                                </div>
                                <div class="box44 flexccc">
                                    <div class="">
                                        <span class="num text">{{
                                            epi.data13.amongNowDetectNumber
                                        }}</span>
                                        <span class="unit text">人</span>
                                    </div>
                                    <div class="label">其中本轮检测</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div
                        v-else-if="epi.cut_content == 4"
                        class="dialog_content4 full-screen flexcb"
                    >
                        <div class="fx1 hidden">
                            <StaticTable
                                :columns="epi.columns14"
                                :data-list="epi.data14"
                                headBg="rgba(22, 159, 196, 0.2)"
                                border_color="rgba(22, 159, 196, 0.25)"
                                headHeight="40"
                            >
                                <template v-slot:col5="{ row }">
                                    <div class="epi_census">
                                        {{ row.col5 }}
                                    </div>
                                </template>
                                <template v-slot:col9="{ row }">
                                    <div class="w-text">
                                        {{
                                            row.col9 == 2
                                                ? "新增人员"
                                                : "未检测人员"
                                        }}
                                    </div>
                                </template>
                            </StaticTable>
                        </div>
                        <!-- 分页 -->
                        <ProPage
                            :pages="epi.pages14"
                            :total="epi.total12"
                            ref="ref_page14"
                            @on_page="changePage($event, 14)"
                        ></ProPage>
                    </div>
                </div>
            </ListDetail>
        </div>

        <!-- 地图弹出 -->
        <div v-if="map_dialog">
            <ProDialog
                @myclose="onMapClose"
                :level="this.epi.queryForm2.level"
                :temporaryListDetailId="temporaryListDetailId"
            ></ProDialog>
        </div>
    </div>
</template>

<script>
import ProTitle from "@/components/Pro/ProTitle";
import ProTitle2 from "@/components/Pro/ProTitle2";
import StaticTable from "@/components/Common/StaticTable.vue";
import ProShade from "./ProShade";
import PieChart from "@/components/Chart/PieChart/PieChart.vue";
import LineChart from "@/components/Chart/LineChart/LineChart.vue";
import BarChart from "@/components/Chart/BarChart/BarChart.vue";
import ListDetail from "./ListDetail";
import DynamicTable from "@/components/Common/DynamicTable.vue";
import ProPage from "./ProPage";
import EpiContentNav from "./EpiContentNav";
import ProDialog from "./ProDialog";
import GaugeChart from "@/components/Chart/GaugeChart/GaugeChart.vue";

import { my_option } from "@/utils/mock/proview/grid";

import {
    listBigScreenGridPage,
    detectRatioRank,
    detailGridInfo,
    detailPeoplePage,
    detailDetectInfo,
    detailCompareResultPage,
    getAllRound,
} from "@/api/epiview.js";
import { people } from "@/utils/mock/proview/people";

import { getCompany } from "@/api/proview.js";

export default {
    name: "NavGrid",
    components: {
        ProTitle,
        ProTitle2,
        DynamicTable,
        StaticTable,
        ProShade,
        PieChart,
        LineChart,
        BarChart,
        ListDetail,
        ProPage,
        EpiContentNav,
        ProDialog,
        GaugeChart,
    },
    props: {
        company_type: {
            type: Array,
            default: () => [],
        },
    },
    data() {
        return {
            map_dialog: false,
            loading: false,
            loading2: false,
            compnyType: false,
            //信息-------------------------------
            epi: {
                // 左侧-------------------------
                pages: 1,
                data: [{ title: 1, col2: "XXXWH网格", col3: 90 }],
                columns1: my_option.columns1,
                queryForm: {
                    sort_by: false, // asc (true) 正序  desc(false) 倒序
                    company_name: "",
                    roundId: null,
                    lastTimeFlag: true,
                },
                // 右侧----------------------------
                data2: [],
                columns2: my_option.columns2,
                queryForm2: {
                    current: 1,
                    gridName: "",
                    level: 2,
                    size: 10,
                    sortList: [
                        {
                            asc: false,
                            column: "",
                        },
                    ],
                },
                total2: 1,
                pages2: 1,

                // 详情-----------------------------------------------
                open_detail: false,
                detail_title: "南康社区",
                cut_detail_id: "",
                cut_content: 1,
                detail_btn: [
                    { label: "网格信息", id: 1 },
                    { label: "居民信息", id: 2 },
                    { label: "检测信息", id: 3 },
                    { label: "对比名单", id: 4 },
                ],
                // 网格信息-----
                data11: {},
                // 区民列表
                queryForm12: {
                    current: 1,
                    gridId: 0,
                    name: "",
                    size: 10,
                    sortList: [
                        {
                            asc: false,
                            column: "",
                        },
                    ],
                },
                columns12: my_option.columns12,
                data12: [],
                total12: 1,
                pages12: 1,

                // 检测信息----------
                options13: [],
                roundId: 30,
                data13: {},
                seriesDataPie: [
                    {
                        name: "已检测",
                        value: 80,
                    },
                    {
                        name: "未检测",
                        value: 20,
                    },
                ],
                extraOptionPie: my_option.extraOptionPie,
                seriesDataPie2: [
                    {
                        name: "已核实",
                        value: 80,
                    },
                    {
                        name: "未核实",
                        value: 20,
                    },
                ],
                extraOptionPie2: my_option.extraOptionPie2,
                seriesDataGauge: [
                    {
                        value: 92.85,
                        // name: "整改",
                    },
                ],
                seriesDataGauge2: [
                    {
                        value: 92.85,
                        // name: "整改",
                    },
                ],
                extraOptionsGauge: my_option.extraOptionsGauge,

                // 对比名单----------
                queryForm14: {
                    current: 1,
                    gridId: 0,
                    size: 10,
                    sortList: [
                        {
                            asc: false,
                            column: "",
                        },
                    ],
                },
                columns14: my_option.columns14,
                data14: {},
                total14: 1,
                pages14: 1,
            },
            // 地图点的集合
            MarkerData: [],

            //临时造假数据用到，点击列表页获取详情id，只展示自然村3，4，5三条数据详情，后面对接接口干掉
            temporaryListDetailId: 0,
        };
    },
    computed: {
        // 行业类型
        getIndustry() {
            return (s) => {
                s = Number(s);
                let temp = null;
                switch (s) {
                    case 1:
                        temp = "农、林、牧、渔业";
                        break;
                    case 2:
                        temp = "采矿业";
                        break;
                    case 3:
                        temp = "制造业";
                        break;
                    case 4:
                        temp = "电力、热力、燃气及生产和供应业";
                        break;
                    case 5:
                        temp = "建筑业";
                        break;
                    case 6:
                        temp = "批发和零售业";
                        break;
                    case 7:
                        temp = "交通运输、仓储和邮政业";
                        break;
                    case 8:
                        temp = "住宿和餐饮业";
                        break;
                    case 9:
                        temp = "信息传输、软件和信息技术服务业";
                        break;
                    case 10:
                        temp = "金融业";
                        break;
                    default:
                        temp = "空";
                }
                return temp;
            };
        },
    },
    watch: {},
    created() {
        this.getData();
        this.getData2();
        this.getAllRound();
    },
    mounted() {},
    methods: {
        /** 关闭地图的消息弹窗(给父组件调用) */
        closeMap(id) {
            this.MarkerData.forEach((item) => {
                if (id == this.epi.cut_detail_id) {
                    // 点击x号 关闭 当前消息窗口
                    item.level = 28;
                } else {
                    // 点击另外的地图标点, 关闭旧窗口, 打开新窗口时, 保留新窗口的icon高亮
                    if (item.id != this.epi.cut_detail_id) {
                        item.level = 28;
                    }
                }
            });
        },
        /** 点击地图弹窗详情(给父组件调用) */
        detailMap(id) {
            this.epi.open_detail = true;
            this.epi.cut_detail_id = id;
        },
        /** 点击表格的某行 */
        onRow2(row) {
            // this.epi.cut_content = 1;
            this.epi.cut_detail_id = row.id;
            this.epi.detail_title = row.col2;
            this.epi.open_detail = true;
            this.detailGridInfo();
            this.detailPeoplePage();
            this.detailDetectInfo();
            this.detailCompareResultPage();
        },

        /** 点击企业列表 的某列 */
        onClick(row, col) {},

        /** 关闭列表明细 */
        onCloseInfo() {
            this.epi.open_detail = false;
        },

        /** 重置弹窗数据 */
        reset() {
            this.epi.open_detail = false;
            this.$refs["ref_detail"].reset();
        },
        /** 分页切换 */
        changePage(num, type) {
            if (type == 1) {
                this.epi.queryForm.current = num;
                this.getData();
            } else if (type == 2) {
                this.epi.queryForm2.current = num;
                this.getData2();
            } else if (type == 12) {
                this.epi.queryForm12.current = num;
                this.detailPeoplePage();
            } else if (type == 14) {
                this.epi.queryForm12.current = num;
                this.detailCompareResultPage();
            }
        },

        /** 搜索 */
        searchChange(type = 1) {
            this.epi.queryForm.current = 1;
            if (this.$refs["ref_page1"]) this.$refs["ref_page1"].resetPage();
            if (type == 2) {
                this.epi.queryForm.lastTimeFlag = true;
            } else if (type == 3) {
                this.epi.queryForm.sort_by = false;
            } else if (type == 4) {
                this.epi.queryForm.sort_by = true;
            }
            this.getData();
        },
        /** 搜索 */
        searchChange2(type) {
            this.epi.queryForm2.current = 1;
            if (this.$refs["ref_page2"]) this.$refs["ref_page2"].resetPage();
            if (type == -1) {
                this.epi.queryForm2.gridName = "";
                this.epi.queryForm2.level = 2;
            } else if (type != 0) {
                this.epi.queryForm2.level = type;
            }
            this.getData2();
        },
        /** 搜索 */
        searchChange12(type) {
            this.epi.queryForm12.current = 1;
            if (this.$refs["ref_page12"]) this.$refs["ref_page12"].resetPage();
            if (type == -1) {
                this.epi.queryForm12.name = "";
            }
            this.detailPeoplePage();
        },
        /** 搜索 */
        searchChange13(type) {
            if (type == -1) {
                if (this.epi.options13 && this.epi.options13.length > 0) {
                    this.epi.roundId = this.epi.options13[0].value;
                }
            }
            this.detailDetectInfo();
        },
        /** 弹窗内容切换 */
        changeContent(id) {
            this.epi.cut_content = id;
        },
        /** 获取所有核酸的轮次 */
        getAllRound() {
            getAllRound().then((res) => {
                if (res.code == 0) {
                    this.epi.options13 = res.data.map((item) => {
                        return {
                            label: item.title,
                            value: item.id,
                        };
                    });
                }
            });
        },
        /** 左侧列表数据 */
        getData() {
            this.loading = true;
            let temp = {
                lastTimeFlag: this.epi.queryForm.lastTimeFlag, //查看最近一次
                positiveSequenceFlag: this.epi.queryForm.sort_by, //正序倒序
                roundId: this.epi.queryForm.roundId || 31, //轮次
            };
            detectRatioRank(temp).then((res) => {
                if (res.code == 0) {
                    this.epi.total = res.data.length; // res.data.total;
                    this.epi.data = res.data.map((item, index) => {
                        return {
                            id: item.id,
                            title: index + 1,
                            col2: item.gridName,
                            col3: Number(
                                (parseFloat(item.ratio) * 100).toFixed(2)
                            ),
                            // col3: item.peopleNumber,
                        };
                    });
                } else {
                    this.epi.data2 = [];
                }
                this.loading = false;
            });
        },
        getData2() {
            this.loading2 = true;
            let temp = {
                current: this.epi.queryForm2.current,
                size: this.epi.queryForm2.size,
                level: this.epi.queryForm2.level,
                gridName: this.epi.queryForm2.gridName,
            };
            listBigScreenGridPage(temp).then((res) => {
                if (res.code == 0) {
                    this.epi.total2 = res.data.total;
                    this.epi.pages2 = Math.ceil(
                        parseInt(res.data.total) / parseInt(res.data.size)
                    );
                    this.epi.data2 = res.data.records.map((item, index) => {
                        return {
                            id: item.id,
                            title: index + 1,
                            col2: item.gridName,
                            col3: item.parentGridName,
                            col4: item.peopleNumber,
                        };
                    });
                } else {
                    this.epi.data2 = [];
                }
                this.loading2 = false;
            });
        },

        /** 详情页--网格信息 */
        detailGridInfo() {
            detailGridInfo({ gridId: this.epi.cut_detail_id }).then((res) => {
                if (res.code == 0) {
                    this.epi.data11 = res.data;
                }
            });
        },
        /** 详情页--居民列表 */
        detailPeoplePage() {
            this.epi.queryForm12.gridId = this.epi.cut_detail_id;
            detailPeoplePage(this.epi.queryForm12).then((res) => {
                if (res.code == 0) {
                    this.epi.total12 = res.data.total;
                    this.epi.pages12 = Math.ceil(
                        parseInt(res.data.total) / parseInt(res.data.size)
                    );
                    this.epi.data12 = res.data.records.map((item) => {
                        return {
                            title: item.name,
                            col2: item.idCard,
                            col3: item.mobile,
                            col4: item.d || "-",
                        };
                    });
                }
            });
        },
        /** 详情页--检测信息 */
        detailDetectInfo() {
            detailDetectInfo({
                gridId: this.epi.cut_detail_id,
                roundId: this.epi.roundId,
            }).then((res) => {
                if (res.code == 0) {
                    console.log(456);
                    this.epi.data13 = res.data;
                    this.seriesDataGauge = [
                        {
                            value: res.data.lastChangeRatio,
                        },
                    ];
                    this.seriesDataGauge2 = [
                        {
                            value: res.data.lastChangeRatio,
                        },
                    ];
                    this.seriesDataPie = [
                        {
                            name: "已检测",
                            value: res.data.detectedNumber,
                        },
                        {
                            name: "未检测",
                            value: res.data.noDetectNumber,
                        },
                    ];
                    this.seriesDataPie2 = [
                        {
                            name: "已核实",
                            value: res.data.verifiedNumber,
                        },
                        {
                            name: "未核实",
                            value: res.data.noVerifiedNumber,
                        },
                    ];
                }
            });
        },
        /** 详情页--比对名单列表 */
        detailCompareResultPage() {
            this.epi.queryForm14.gridId = this.epi.cut_detail_id;
            detailCompareResultPage(this.epi.queryForm14).then((res) => {
                if (res.code == 0) {
                    this.epi.total14 = res.data.total;
                    this.epi.pages14 = Math.ceil(
                        parseInt(res.data.total) / parseInt(res.data.size)
                    );
                    this.epi.data14 = res.data.records.map((item, index) => {
                        return {
                            title: index + 1,
                            col2: item.name,
                            col3: item.idCard,
                            col4: item.mobile,
                            col5: item.d,
                            col6: item.reason,
                            col7: item.d,
                            col8: item.d,
                            col9: item.type,
                        };
                    });
                }
            });
        },

        /** 点击地图标点emit=false  点击table弹出简介信息时emit=true */
        getIntroduction(id, emit = false) {
            this.epi.cut_detail_id = id;
            getCompany(id).then((res) => {
                if (res.code == 0) {
                    let data = res.data;
                    this.epi.detail_title = data.company_name;

                    let temp = [
                        {
                            label: "名称",
                            value: data.company_name,
                        },
                        {
                            label: "行业类型",
                            value: this.getIndustry(data.industry_type),
                            is_industry: true,
                        },
                        {
                            label: "法定代表人",
                            value: data.legal_name,
                        },
                        {
                            label: "法人电话",
                            value: data.legal_phone,
                            is_tel: false,
                        },
                        {
                            label: "查看详情",
                            value: "",
                            is_detail: true,
                            is_video: false,
                        },
                    ];
                }
            });
        },
        /** 点击地图覆盖物emit=false  点击table弹出简介信息时emit=true */
        getIntroduction2(obj, emit = false) {
            this.map_dialog = true;
        },
        onMapClose() {
            this.map_dialog = false;
        },
    },
};
</script>

<style lang="scss">
.el-image-viewer__wrapper {
    top: vh(100);
    bottom: vh(100);
    left: vh(200);
    right: vh(200);
}

.el-loading-spinner .circular .path {
    stroke: #2ef7fc !important;
}

.el-progress__text {
    color: #fff;
    margin-left: vw(24);
}
.el-progress-bar__inner {
    border-radius: vw(1);
    background: linear-gradient(90deg, #0f699c 0%, #49d4ff 100%);
}
</style>

<style lang="scss" scoped>
.container {
    ::v-deep .el-input__inner {
        color: white;
    }
    ::v-deep .el-input--medium .el-input__inner {
        background-color: #002440;
        border: 1px solid #094666;
    }
    .process_line {
        width: vw(200);
        ::v-deep .el-progress-bar__outer {
            border-radius: 0;
            background-color: rgba(255, 255, 255, 0.1);
        }
    }

    .left {
        position: absolute;
        z-index: 12;
        left: vw(30);
        top: vh(88);
        bottom: vh(40);
        width: vw(520);
        .sort_box {
            .sort_btn {
                cursor: pointer;
                padding: 0px 10px;
                height: vh(32);
                background: #002440; // 16171F
                border: 1px solid rgba(22, 159, 196, 0.25);
                .txt {
                    font-size: 14px;
                    color: white;
                }
                &.active {
                    background: rgba(22, 159, 196, 0.2);
                    .txt {
                        color: #61ffff;
                    }
                }
            }
        }
        .title_box {
            padding: 0 vw(8);
            min-width: vw(24);
            text-align: center;
            background: rgba(22, 159, 196, 0.2);
            border: 1px solid rgba(45, 205, 255, 0.24);
            border-radius: 2px;
            color: #2dcdff;
        }
    }

    .right {
        position: absolute;
        z-index: 12;
        right: vw(30);
        top: vh(88);
        bottom: vh(40);
        width: vw(520);
        .right-content {
            .grade_box {
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                .sort_btn {
                    cursor: pointer;
                    padding: 0px 10px;
                    height: vh(32);
                    background: #002440; // 16171F
                    border: 1px solid rgba(22, 159, 196, 0.25);
                    .txt {
                        font-size: 14px;
                        color: white;
                    }
                    &.active {
                        background: rgba(22, 159, 196, 0.2);
                        .txt {
                            color: #61ffff;
                        }
                    }
                }
            }
        }
    }

    .iconfont {
        margin-right: vw(5);
    }

    // 弹出层
    .dialog_box {
        position: absolute;
        z-index: 15;
        left: 0;
        top: vh(56);
        height: calc(100% - vh(56));
        width: 100%;
        background: rgba(0, 6, 17, 0.5);
        backdrop-filter: blur(20px);

        .dialog_content1 {
            .content_left {
                .item {
                    width: vw(400);
                    height: vh(220);
                    .icon {
                        width: vw(120);
                        height: vw(120);
                        margin-right: vw(30);
                    }
                    .icon1 {
                        background: url("~@/assets/images/proview/grid1.png")
                            no-repeat;
                        background-size: 100% 100%;
                    }
                    .icon2 {
                        background: url("~@/assets/images/proview/grid2.png")
                            no-repeat;
                        background-size: 100% 100%;
                    }
                    .info {
                        .num1,
                        .unit1 {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num2,
                        .unit2 {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #f5d665 0%,
                                #e39c49 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num1,
                        .num2 {
                            font-size: vw(40);
                        }
                        .unit1,
                        .unit2 {
                            font-size: vw(14);
                        }
                        .label {
                            background: rgba(22, 159, 196, 0.2);
                            border-radius: 2px;
                            text-align: center;
                            color: #fff;
                            padding: vh(3) 0;
                            width: 100%;
                        }
                        .label1 {
                            background: rgba(22, 159, 196, 0.2);
                        }
                        .label2 {
                            background: rgba(227, 156, 73, 0.2);
                        }
                    }
                }
                .item_grid1 {
                    border: 1px solid rgba(22, 159, 196, 0.3);
                    background: url("~@/assets/images/proview/grid_bg1.png")
                        no-repeat;
                    background-size: 100% 100%;
                }
                .item_grid2 {
                    border: 1px solid rgba(227, 156, 73, 0.3);
                    background: url("~@/assets/images/proview/grid_bg2.png")
                        no-repeat;
                    background-size: 100% 100%;
                }
            }
            .content_right {
                .item {
                    border: 1px solid rgba(22, 159, 196, 0.25);
                    padding: vh(24) vw(20);

                    .label {
                        color: #fff;
                        margin-right: vw(20);
                    }
                    .value {
                        color: #2ef7fc;
                    }
                    .tel {
                        margin-left: vw(20);
                        color: #fff;
                    }
                    .list {
                        display: grid;
                        grid-template-columns: repeat(5, 1fr);
                        grid-template-rows: auto;
                        gap: vh(10) vw(10);
                        color: #2ef7fc;
                        .list_item {
                        }
                    }
                }
                .top {
                    background: rgba(22, 159, 196, 0.2);
                }
                .bottom {
                    // background: rgba(22, 159, 196, 0.2);
                }
            }
        }
        .dialog_content2 {
            .info_box {
                background: rgba(22, 159, 196, 0.2);
                border: 1px solid rgba(22, 159, 196, 0.25);
                .label {
                    color: #fff;
                    margin-right: vw(10);
                }
                .value {
                    font-family: "D-DIN";
                    font-weight: 700;
                    font-size: vw(24);
                    background: linear-gradient(
                        180deg,
                        #61ffff 0%,
                        #2dcdff 100%
                    );
                    -webkit-background-clip: text;
                    -webkit-text-fill-color: transparent;
                    background-clip: text;
                    text-fill-color: transparent;
                }
            }
        }
        .dialog_content3 {
            .select_box {
                .icon {
                    color: #2ef7fc;
                }
                .label {
                    color: #fff;
                    margin-left: vw(5);
                }
                .select_grade {
                    margin-left: vw(20);
                }
                .search_btn {
                    width: vw(100);
                    cursor: pointer;
                    height: vh(36);
                    background: linear-gradient(
                        180deg,
                        #033748 0%,
                        #169fc4 100%
                    );
                    border: 1px solid rgba(41, 173, 249, 0.4);
                    .txt {
                        font-size: 14px;
                        color: white;
                    }
                }
                .reset_btn {
                    width: vw(100);
                    cursor: pointer;
                    height: vh(36);
                    background: #002440; // 16171F
                    border: 1px solid rgba(41, 173, 249, 0.4);
                    .txt {
                        font-size: 14px;
                        color: white;
                    }
                }
            }
            .data_box {
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                grid-template-rows: 1fr;
                gap: 0 vh(20);
                .box1 {
                    border: 1px solid rgba(22, 159, 196, 0.3);
                    padding: vw(20);
                    .box1_top {
                        height: vh(127);
                        background: url("~@/assets/images/proview/box1_top.png")
                            no-repeat;
                        background-size: 100% 100%;
                        .text {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num {
                            font-size: vw(40);
                        }
                        .unit {
                            font-size: vw(14);
                        }
                        .label {
                            color: #ffffff;
                        }
                    }
                    .box1_bottom {
                        border: 1px solid rgba(22, 159, 196, 0.3);
                        background: linear-gradient(
                            180deg,
                            rgba(22, 159, 196, 0.12) 0%,
                            rgba(22, 159, 196, 0) 100%
                        );
                        padding: vw(10);
                        .text {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num {
                            font-size: vw(40);
                        }
                        .rise {
                            background: rgba(22, 159, 196, 0.2);
                            border: 1px solid rgba(22, 159, 196, 0.25);
                            border-radius: 2px;
                            color: #ff3a3a;
                            margin-left: vw(10);
                            padding: vh(5) vw(8);
                            font-weight: 600;
                            font-size: vw(16);
                            border-radius: vw(3);
                        }
                        .label {
                            color: #ffffff;
                        }
                    }
                }
                .box2 {
                    .box2_top {
                        border: 1px solid rgba(22, 159, 196, 0.3);
                        padding: vw(20);
                        .chart_box {
                            height: vw(200);
                            width: vw(200);
                            background: url("~@/assets/images/proview/cle.png")
                                no-repeat;
                            background-size: 100% 100%;
                        }
                        .info {
                            width: 100%;
                            .item {
                                // padding: vh(10) vw(12);
                                color: #fff;
                                .num {
                                    font-family: "D-DIN";
                                    font-style: normal;
                                    font-weight: 700;
                                    font-size: vw(20);
                                }
                            }
                            .top {
                                // background: rgba(22, 159, 196, 0.2);
                                // border: 1px solid rgba(22, 159, 196, 0.25);
                                .icon {
                                    color: #2dcdff;
                                }
                            }
                            .bottom {
                                // background: rgba(238, 144, 104, 0.2);
                                // border: 1px solid rgba(238, 144, 104, 0.25);
                                .icon {
                                    color: #ee9068;
                                }
                            }
                        }
                    }

                    .box2_bottom {
                        padding: vw(20);
                        height: vh(84);
                        background: rgba(22, 159, 196, 0.2);
                        border: 1px solid rgba(22, 159, 196, 0.25);
                        .label {
                            color: #ffffff;
                        }
                        .num {
                            font-family: "D-DIN";
                            font-weight: 700;
                            font-size: vw(24);
                            background: linear-gradient(
                                180deg,
                                #ffc27a 0%,
                                #ff9a3d 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                    }
                }
                .box3 {
                    .box3_top {
                        border: 1px solid rgba(22, 159, 196, 0.3);
                        padding: vw(20);
                        .chart_box {
                            height: vw(200);
                            width: vw(200);
                            background: url("~@/assets/images/proview/cle.png")
                                no-repeat;
                            background-size: 100% 100%;
                        }
                        .info {
                            width: 100%;
                            .item {
                                // padding: vh(10) vw(12);
                                color: #fff;
                                .num {
                                    font-family: "D-DIN";
                                    font-style: normal;
                                    font-weight: 700;
                                    font-size: vw(20);
                                }
                            }
                            .top {
                                // background: rgba(22, 159, 196, 0.2);
                                // border: 1px solid rgba(22, 159, 196, 0.25);
                                .icon {
                                    color: #2dcdff;
                                }
                            }
                            .bottom {
                                // background: rgba(238, 144, 104, 0.2);
                                // border: 1px solid rgba(238, 144, 104, 0.25);
                                .icon {
                                    color: #ee9068;
                                }
                            }
                        }
                    }

                    .box3_bottom {
                        padding: vw(20);
                        height: vh(84);
                        background: rgba(22, 159, 196, 0.2);
                        border: 1px solid rgba(22, 159, 196, 0.25);
                        .label {
                            color: #ffffff;
                        }
                        .num {
                            font-family: "D-DIN";
                            font-weight: 700;
                            font-size: vw(24);
                            background: linear-gradient(
                                180deg,
                                #ff7a7a 0%,
                                #ff3d3d 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                    }
                }
                .box4 {
                    border: 1px solid rgba(22, 159, 196, 0.3);
                    padding: vw(20);
                    .box41 {
                        height: vh(130);
                        width: 100%;
                    }
                    .box42 {
                        background: rgba(45, 164, 255, 0.1);
                        border: 0.675px solid rgba(45, 204, 255, 0.2);
                        color: #ffffff;
                        height: vw(35);
                        width: vw(180);
                        font-size: vw(13);
                    }
                    .box43,
                    .box44 {
                        height: vh(80);
                        width: vw(180);
                        background: url("~@/assets/images/proview/num_box.png")
                            no-repeat;
                        background-size: 100% 100%;
                        .text {
                            font-family: "D-DIN";
                            font-style: normal;
                            font-weight: 700;
                            background: linear-gradient(
                                180deg,
                                #61ffff 0%,
                                #2dcdff 100%
                            );
                            -webkit-background-clip: text;
                            -webkit-text-fill-color: transparent;
                            background-clip: text;
                            text-fill-color: transparent;
                        }
                        .num {
                            font-size: vw(40);
                        }
                        .unit {
                            font-size: vw(14);
                        }
                        .label {
                            color: #ffffff;
                        }
                    }
                }
            }
        }
    }
}
</style>
